home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qbasicpg.zip / UCASE_EX.BAS < prev    next >
BASIC Source File  |  1988-09-17  |  787b  |  34 lines

  1. '
  2. ' *** UCASE_EX.BAS -- UCASE$ function programming example
  3. '
  4. DEFINT A-Z
  5.  
  6. FUNCTION YesQues(Prompt$,Row,Col) STATIC
  7.    OldRow=CSRLIN
  8.    OldCol=POS(0)
  9.    ' Print prompt at Row, Col.
  10.    LOCATE Row,Col : PRINT Prompt$ "(Y/N):";
  11.    DO
  12.       ' Get the user to press a key.
  13.       DO
  14.      Resp$=INKEY$
  15.       LOOP WHILE Resp$=""
  16.       Resp$=UCASE$(Resp$)
  17.       ' Test to see if it's yes or no.
  18.       IF Resp$="Y" OR Resp$="N" THEN
  19.      EXIT DO
  20.       ELSE
  21.      BEEP
  22.       END IF
  23.    LOOP
  24.    ' Print the response on the line.
  25.    PRINT Resp$;
  26.    ' Move the cursor back to the old position.
  27.    LOCATE OldRow,OldCol
  28.    ' Return a Boolean value by returning the result of a test.
  29.    YesQues=(Resp$="Y")
  30. END FUNCTION
  31.  
  32. DO
  33. LOOP WHILE NOT YesQues("Do you know the frequency?",12,5)
  34.